package com.dhcc.utils;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * 具体功能实现于 com.dhcc.utils.string
 * @see java.lang.String String 辅助工具类
 * @author bin
 *
 */
public class __String {
	private static final Map<String, String> map;
	private static final Map<String, Operator<String>> operators;
	static{
		map = UtilUtil.scan("com.dhcc.utils.string");
		operators = new ConcurrentHashMap<String, Operator<String>>(map.size());
	}
	/**
	 * 执行字符串的操作
	 * @param operator
	 * @param str
	 * @param args
	 * @return
	 */
	public static <T> T op(String operator, String str, Object... args){
		return UtilUtil.<T, String>op(map, operators, operator, str, args);
	}
	
	public static void registry(String name, Class<? extends Operator<String>> clazz){
		UtilUtil.<String>registry(name, clazz, map);
	}
}
